
// Online C++ Compiler - Build, Compile and Run your C++ programs online in your favorite browser

#include <iostream>
#include <string>
#include <algorithm>

int main() {
    std::string s;
    std::getline(std::cin, s);

    s.erase(std::remove(s.begin(), s.end(), ' '), s.end());

    while (s.find("()") != std::string::npos || s.find("[]") != std::string::npos ||
           s.find("{}") != std::string::npos || s.find("<>") != std::string::npos) {
        size_t pos;
        while ((pos = s.find("()")) != std::string::npos) s.erase(pos, 2);
        while ((pos = s.find("[]")) != std::string::npos) s.erase(pos, 2);
        while ((pos = s.find("{}")) != std::string::npos) s.erase(pos, 2);
        while ((pos = s.find("<>")) != std::string::npos) s.erase(pos, 2);
    }

    if (!s.empty()) {
        std::cout << "False" << std::endl;
    } else {
        std::cout << "True" << std::endl;
    }

    return 0;
}